var winston = require('winston');
require('winston-daily-rotate-file');
var transport = new (winston.transports.DailyRotateFile)({
    filename: 'log/info-%DATE%.log',
    datePattern: 'YYYY-MM-DD',
    zippedArchive: true,
    maxSize: '20m',
    maxFiles: '14d'
});
var transportError = new (winston.transports.DailyRotateFile)({
    filename: 'log/error-%DATE%.log',
    datePattern: 'YYYY-MM-DD',
    zippedArchive: true,
    maxSize: '20m',
    maxFiles: '14d'
});
transport.on('rotate', function (oldFilename, newFilename) {
    console.log("************************************");
    console.log(oldFilename, newFilename);
    console.log("************************************");
});
exports.logger = new (winston.Logger)({
    transports: [
        transport
    ],
    exceptionHandlers: [
        new winston.transports.File({ filename: 'logs/exceptions.log' })
    ],
    exitOnError: false
});
exports.loggerError = new (winston.Logger)({
    transports: [
        transportError
    ],
    exceptionHandlers: [
        new winston.transports.File({ filename: 'logs/exceptions.log' })
    ],
    exitOnError: false
});
